Added patches to build for glibc.
authorMazi Lo <[email protected]>
Fri, 2 Feb 2018 02:37:39 +0000 (21:37 -0500)
committerMazi Lo <[email protected]>
Fri, 2 Feb 2018 02:37:39 +0000 (21:37 -0500)
For now, these patches are basically the same for musl library build.

Signed-off-by: Mazi Lo <[email protected]>
14 files changed:
net/freeswitch/patches/glibc/Makefile_am.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/build-config-erlang_m4.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/build-modules_conf_in.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/build-openwrt_rules.mk.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/configure_ac.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/libs-apr-configure_ac.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/libs-apr-util-configure_gnu.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/libs-srtp-configure_ac.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/src-mod-applications-mod_http_cache-conf-autoload_configs-http_cache_conf_xml.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/src-mod-endpoints-mod_sofia-conf-sofia_conf_xml.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/src-mod-endpoints-mod_verto-Makefile_am.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/src-mod-languages-mod_perl-Makefile_am.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/src-mod-languages-mod_python-Makefile_am.patch [new file with mode: 0644]
net/freeswitch/patches/glibc/src-mod-languages-mod_python-freeswitch_python_cpp.patch [new file with mode: 0644]

diff --git a/net/freeswitch/patches/glibc/Makefile_am.patch b/net/freeswitch/patches/glibc/Makefile_am.patch
new file mode 100644 (file)
index 0000000..d08c6a1
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -559,7 +559,7 @@ libs/libzrtp/libzrtp.a:
+       cd libs/libzrtp && $(MAKE)
+ libs/libvpx/Makefile:
+-      cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --extra-cflags="$(VISIBILITY_FLAG)"
++      cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" CROSS="$(ARCH)-openwrt-linux LD=$(CXX)" ./configure --target=generic-gnu --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --extra-cflags="$(VISIBILITY_FLAG)"
+ libs/libvpx/libvpx.a: libs/libvpx/Makefile
+       @cd libs/libvpx && $(MAKE)
diff --git a/net/freeswitch/patches/glibc/build-config-erlang_m4.patch b/net/freeswitch/patches/glibc/build-config-erlang_m4.patch
new file mode 100644 (file)
index 0000000..5d744f7
--- /dev/null
@@ -0,0 +1,97 @@
+--- a/build/config/erlang.m4
++++ b/build/config/erlang.m4
+@@ -1,6 +1,6 @@
+ AC_DEFUN([CHECK_ERLANG], [
+ #
+-# Erlang checks for mod_erlang_event
++# Erlang check
+ #
+ AC_ARG_WITH(
+       [erlang],
+@@ -20,22 +20,23 @@ then
+               if test ! -x "$with_erlang" ; then
+                       AC_MSG_ERROR([Specified erlang does not exist or is not executable: $with_erlang])
+               fi
+-              AC_MSG_RESULT([$with_erlang])
+-              AC_SUBST([ERLANG], ["$with_erlang"])
++              AC_MSG_RESULT(["$with_erlang/bin/erl"])
++              AC_SUBST([ERL],["$with_erlang/bin/erl"])
+       else
+-              AC_PATH_PROG([ERLANG], ["erl"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
++              AC_ERLANG_NEED_ERL(["$with_erlang/bin"])
+       fi
+-      if test "$ERLANG" != "no" ; then
++      if test "$ERL" != "no" ; then
+               AC_MSG_CHECKING([erlang version])
+-              ERLANG_VER="`$ERLANG -version 2>&1 | cut -d' ' -f6`"
++              ERLANG_VER="`$ERL -version 2>&1 | cut -d' ' -f6`"
+               if test -z "$ERLANG_VER" ; then
+                       AC_MSG_ERROR([Unable to detect erlang version])
++              else
++                      AC_MSG_RESULT([$ERLANG_VER])
+               fi
+-              AC_MSG_RESULT([$ERLANG_VER])
+-              ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
++              ERLANG_LIBDIR=`$ERL -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
+               AC_MSG_CHECKING([erlang libdir])
+               if test -z "`echo $ERLANG_LIBDIR`" ; then
+                       AC_MSG_ERROR([failed])
+@@ -43,9 +44,16 @@ then
+                       ERLANG_LDFLAGS="-L$ERLANG_LIBDIR $ERLANG_LDFLAGS"
+                       LIBS="-L$ERLANG_LIBDIR $LIBS"
+               fi
++
++              #
++              # Don't use the above ERLANG_LDFLAGS
++              #
++              ERLANG_LIBDIR="${STAGING_DIR}/usr/lib"
++              ERLANG_LDFLAGS="-L$ERLANG_LIBDIR"
++              LIBS="-L$ERLANG_LIBDIR $LIBS"
+               AC_MSG_RESULT([$ERLANG_LIBDIR])
+-              ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
++              ERLANG_INCDIR=`$ERL -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
+               AC_MSG_CHECKING([erlang incdir])
+               if test -z "`echo $ERLANG_INCDIR`" ; then
+                       AC_MSG_ERROR([failed])
+@@ -59,10 +67,11 @@ then
+               ERLANG_LIB="ei"
+-              # check liei
++              # check libei
+               AC_CHECK_LIB([$ERLANG_LIB], [ei_encode_version], [has_libei="yes"], [has_libei="no"])
+               # maybe someday ei will actually expose this?
+-              AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
++              # until then, we comment it out
++              #AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
+               if test "$has_libei" = "no" ; then
+                       AS_IF([test "$with_erlang" = "try"],
+@@ -76,7 +85,7 @@ then
+                       )
+               else
+                       ERLANG_LDFLAGS="$ERLANG_LDFLAGS -lei"
+-                      AC_MSG_NOTICE([Your erlang seems OK, do not forget to enable mod_erlang_event in modules.conf])
++                      AC_MSG_NOTICE([Your erlang seems OK. You can now use ErLang in your codes.])
+                       AC_SUBST([ERLANG_CFLAGS],  [$ERLANG_CFLAGS])
+                       AC_SUBST([ERLANG_LDFLAGS], [$ERLANG_LDFLAGS])
+                       AM_CONDITIONAL([HAVE_ERLANG],[true])
+@@ -87,12 +96,12 @@ then
+       else
+               AS_IF([test "$with_erlang" = "try"],
+-                      [AC_MSG_WARN([Could not find erlang, mod_erlang_event will not build, use --with-erlang to specify the location])],
++                      [AC_MSG_WARN([Could not find erlang, codes depend on erlang will not build, use --with-erlang to specify the location])],
+                       [AC_MSG_ERROR([Could not find erlang, use --with-erlang to specify the location])]
+               )
+       fi
+ else
+-      AC_MSG_WARN([erlang support disabled, building mod_erlang_event will fail!])
++      AC_MSG_WARN([erlang support disabled!])
+ fi
+ ])
diff --git a/net/freeswitch/patches/glibc/build-modules_conf_in.patch b/net/freeswitch/patches/glibc/build-modules_conf_in.patch
new file mode 100644 (file)
index 0000000..8fee317
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/build/modules.conf.in
++++ b/build/modules.conf.in
+@@ -39,6 +39,7 @@ applications/mod_httapi
+ #applications/mod_rad_auth
+ #applications/mod_redis
+ #applications/mod_rss
++#applications/mod_skel
+ applications/mod_sms
+ #applications/mod_sms_flowroute
+ #applications/mod_snapshot
diff --git a/net/freeswitch/patches/glibc/build-openwrt_rules.mk.patch b/net/freeswitch/patches/glibc/build-openwrt_rules.mk.patch
new file mode 100644 (file)
index 0000000..31fb16f
--- /dev/null
@@ -0,0 +1,10 @@
+--- /dev/null
++++ b/build/openwrt_rules.mk
+@@ -0,0 +1,7 @@
++OPENWRT_DIR=$(shell (cd $(BASE)/../../..;pwd))
++STAGING_PREFIX=$(OPENWRT_DIR)/staging_dir/host
++STAGING_DIR=$(OPENWRT_DIR)/staging_dir/$(shell (cd $(BASE)/..;basename `pwd`))
++ARCH="$(shell grep CONFIG_ARCH $(OPENWRT_DIR)/.config|cut -d= -d'"' -f2)"
++GNU_TARGET_NAME=$(ARCH)-openwrt-linux
++
++include $(OPENWRT_DIR)/rules.mk
diff --git a/net/freeswitch/patches/glibc/configure_ac.patch b/net/freeswitch/patches/glibc/configure_ac.patch
new file mode 100644 (file)
index 0000000..1a1c88c
--- /dev/null
@@ -0,0 +1,178 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -257,9 +257,9 @@ AX_COMPILER_VENDOR
+ if test "x${cross_compiling}" = "xyes"; then
+     CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
+     case "$host" in
+-       arm*-linux-gnueabi*|arm*-*-linux-gnueabi*)
++       arm*-linux-gnueabi*|arm*-*-linux-*)
+               # spandsp modem
+-              ac_cv_file__dev_ptmx=yes
++              ac_cv_file__dev_ptmx=no
+               # libjs
+               export ac_cv_va_copy=yes
+               # srtp
+@@ -276,7 +276,7 @@ if test "x${cross_compiling}" = "xyes";
+               export apr_cv_mutex_recursive=yes
+               export ac_cv_func_pthread_rwlock_init=yes
+               export apr_cv_type_rwlock_t=yes
+-              export apr_cv_process_shared_works=yes
++              #export apr_cv_process_shared_works=no
+               export apr_cv_mutex_robust_shared=yes
+        ;;
+     esac
+@@ -419,10 +419,6 @@ elif test "x${ax_cv_c_compiler_vendor}"
+     APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC -ffast-math)
+     APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC -ffast-math)
+     AC_SUBST([AM_MOD_AVMD_CXXFLAGS], [-std=gnu99])      # FS-8809, needed for MAP_POPULATE
+-    if test "$ac_cv_gcc_supports_w_no_unused_result" = yes; then
+-      APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)
+-      APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)
+-    fi
+     if test "$ac_cv_gcc_supports_w_no_misleading_indentation" = yes; then
+       APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-misleading-indentation)
+     fi
+@@ -948,7 +944,6 @@ AC_CHECK_LIB(pthread, pthread_setschedpa
+ AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
+-AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
+ AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
+ AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
+@@ -1560,18 +1555,18 @@ AM_CONDITIONAL([HAVE_MYSQL],[test "$foun
+ # perl checks
+ #
+-AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no])
+-
+-# -a "x$ac_cv_have_EXTERN_h" != "xno"
++AC_CHECK_PROG(PERL,[perl],[yes],[no],[${STAGING_DIR_HOSTPKG}/usr/bin])
++PERL=$as_dir/$ac_word$ac_exec_ext
+-if test "x$ac_cv_have_perl" != "xno"; then
+-   PERL=perl
+-   PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{archlib}'`"
+-   PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE"
+-   PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`"
+-   PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts | sed -e 's|-arch x86_64 -arch i386||'` -DEMBED_PERL"
+-   PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e 's|-arch x86_64 -arch i386||'`"
+-   PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`"
++if test "x$ac_cv_prog_PERL" != "xno"; then
++   PERL_VERSION="`$PERL -e 'print substr($^V, 1)' | cut -d. -f1,2`"
++   PERL_SITEDIR_LOCAL="`$PERL -MConfig -e 'print $Config{archlibexp}'`"
++   PERL_SITEDIR="`find ${STAGING_DIR}/usr -name $PERL_VERSION -print`"
++   PERL_LIBDIR="-L$PERL_SITEDIR/CORE"
++   PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}' | sed -e 's|-lnsl ||g;s| -lgdbm_compat||g'`"
++   PERL_CFLAGS="-w -DMULTIPLICITY -D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV `$PERL -MExtUtils::Embed -e ccopts | sed -e \"s|$PERL_SITEDIR_LOCAL|$PERL_SITEDIR|g;s| -I/usr/local/include||g\"` -DEMBED_PERL"
++   PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e \"s| $PERL_SITEDIR_LOCAL/auto/NDBM_File/NDBM_File.a||g;s| $PERL_SITEDIR_LOCAL/auto/ODBM_File/ODBM_File.a||g;s|$PERL_SITEDIR_LOCAL|$PERL_SITEDIR|g;s|.a |.so |g;s|-lnsl ||g;s|-lgdbm_compat ||g;s|/usr/local|${STAGING_DIR}/usr|g\"`"
++   PERL_INC="-I$PERL_SITEDIR/CORE"
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$PERL_CFLAGS"
+@@ -1581,34 +1576,39 @@ if test "x$ac_cv_have_perl" != "xno"; th
+    save_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$PERL_LDFLAGS"
+-   AC_CHECK_LIB([perl], [perl_alloc], ac_cv_use_libperl=yes, ac_cv_use_libperl=no)
++   AC_CHECK_LIB([perl], [perl_alloc], [ac_cv_use_libperl=yes], [ac_cv_use_libperl=no])
+    LDFLAGS="$save_LDFLAGS"
++   AC_SUBST(PERL)
+    AC_SUBST(PERL_SITEDIR)
++   AC_SUBST(PERL_SITEDIR_LOCAL)
+    AC_SUBST(PERL_LIBDIR)
+    AC_SUBST(PERL_LIBS)
+    AC_SUBST(PERL_CFLAGS)
+    AC_SUBST(PERL_LDFLAGS)
+    AC_SUBST(PERL_INC)
++   AC_SUBST(PERL_VERSION)
+ fi
+-AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_have_perl" != "xno" -a "x$ac_cv_have_EXTERN_h" != "xno" -a "x$ac_cv_use_libperl" != "xno"])
++AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_prog_PERL" = "xyes" -a "x$ac_cv_have_EXTERN_h" = "xyes" -a "x$ac_cv_use_libperl" = "xyes"])
++#AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_prog_PERL" != "xno" -a "x$ac_cv_have_EXTERN_h" != "xno"])
+ #
+ # php checks
+ #
+ AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no])
+-AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no])
++dnl AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no],[${STAGING_DIR}/usr/bin])
++AC_CHECK_PROG(PHP_CONFIG,php7-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no],[${STAGING_DIR}/usr/bin])
+ AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"])
+ if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then
+    PHP=php
+-   PHP_CONFIG=php-config
++   PHP_CONFIG=${STAGING_DIR}/usr/bin/php7-config
+    PHP_LDFLAGS="`$PHP_CONFIG --ldflags`"
+    PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto)//g'`"
+    PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`"
+-   PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`"
++   PHP_INC_DIR="`$PHP_CONFIG --includes | cut -d" " -f1 | cut -dI -f2`"
+    PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`"
+    PHP_CFLAGS="`$PHP_CONFIG --includes`"
+    AC_SUBST(PHP_LDFLAGS)
+@@ -1623,7 +1623,7 @@ fi
+ # Python checks for mod_python
+ #
+ AC_ARG_WITH(
+-      [python],
++      [python3],
+       [AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])],
+       [with_python="$withval"],
+       [with_python="try"]
+@@ -1642,17 +1642,18 @@ then
+               AC_MSG_RESULT([$with_python])
+               AC_SUBST([PYTHON], ["$with_python"])
+       else
+-              AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
++              AC_PATH_PROG([PYTHON], ["python3"], ["no"], ["${STAGING_DIR_HOSTPKG}/bin"])
+       fi
+       if test "$PYTHON" != "no" ; then
+               AC_MSG_CHECKING([python version])
+-              PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`"
++              PYTHON_VER=`$PYTHON -c "import sys; print('%d.%d' % (sys.version_info[[0]], sys.version_info[[1]]))"`
+               if test -z "$PYTHON_VER" ; then
+                       AC_MSG_ERROR([Unable to detect python version])
+               fi
+               AC_MSG_RESULT([$PYTHON_VER])
++              AC_SUBST([PYTHON_VER], [$PYTHON_VER])
+               AC_MSG_CHECKING([for python distutils])
+               python_result="`$PYTHON -c 'import distutils;' 2>&1`"
+@@ -1666,12 +1667,12 @@ then
+               if test "$python_has_distutils" != "no" ; then
+                       AC_MSG_CHECKING([location of site-packages])
+-                      PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
++                      if test -d "`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`" ; then
++                              PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
+-                      if test -z "$PYTHON_SITE_DIR" ; then
+-                              AC_MSG_ERROR([Unable to detect python site-packages path])
+-                      elif test ! -d "$PYTHON_SITE_DIR" ; then
+-                              AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!])
++                              if test -z "$PYTHON_SITE_DIR" ; then
++                                      AC_MSG_ERROR([Unable to detect python site-packages path])
++                              fi
+                       fi
+                       AC_MSG_RESULT([$PYTHON_SITE_DIR])
+                       AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR])
+@@ -1679,10 +1680,10 @@ then
+                       #
+                       # python distutils found, get settings from python directly
+                       #
+-                      PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print(\" \".join(flags));' | sed -e 's/-arch i386//g;s/-arch x86_64//g'`"
++                      PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print(\" \".join(flags));'`"
+                       PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print(\" \".join(libs));'`"
+                       PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`"
+-                      PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
++                      PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));' | sed -e 's|\(^.*\)/staging_dir/hostpkg|/${STAGING_DIR}/usr|g'`"
+                       # handle python being installed into /usr/local
+                       AC_MSG_CHECKING([python libdir])
diff --git a/net/freeswitch/patches/glibc/libs-apr-configure_ac.patch b/net/freeswitch/patches/glibc/libs-apr-configure_ac.patch
new file mode 100644 (file)
index 0000000..7c0630f
--- /dev/null
@@ -0,0 +1,55 @@
+--- a/libs/apr/configure.ac
++++ b/libs/apr/configure.ac
+@@ -1624,38 +1624,7 @@ if test "$threads" = "1"; then
+     APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
+     AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
+     AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
+-
+-    # Some systems have setpshared and define PROCESS_SHARED, but don't 
+-    # really support PROCESS_SHARED locks.  So, we must validate that we 
+-    # can go through the steps without receiving some sort of system error.
+-    # Linux and older versions of AIX have this problem.
+-    APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, [
+-      AC_CACHE_CHECK([for working PROCESS_SHARED locks], apr_cv_process_shared_works, [
+-      AC_TRY_RUN([
+-#include <sys/types.h>
+-#include <pthread.h>
+-        int main()
+-        {
+-            pthread_mutex_t mutex;
+-            pthread_mutexattr_t attr;
+-            if (pthread_mutexattr_init(&attr))
+-                exit(1);
+-            if (pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED))
+-                exit(2);
+-            if (pthread_mutex_init(&mutex, &attr))
+-                exit(3);
+-            if (pthread_mutexattr_destroy(&attr))
+-                exit(4);
+-            if (pthread_mutex_destroy(&mutex))
+-                exit(5);
+-            exit(0);
+-        }], [apr_cv_process_shared_works=yes], [apr_cv_process_shared_works=no])])
+-      # Override detection of pthread_mutexattr_setpshared
+-      ac_cv_func_pthread_mutexattr_setpshared=$apr_cv_process_shared_works])
+-
+-    if test "$ac_cv_func_pthread_mutexattr_setpshared" = "yes"; then
+-        APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX
+-    fi
++    APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX
+ fi
+ # See which lock mechanisms we can support on this system.
+@@ -1956,7 +1925,11 @@ fi
+ APR_CHECK_TCP_NODELAY_INHERITED
+ APR_CHECK_O_NONBLOCK_INHERITED
+-APR_CHECK_TCP_NODELAY_WITH_CORK
++
++dnl Check TCP_NODELAY_WITH_CORK ONLY when NOT cross compiling
++if test "$cross_compiling" != yes; then
++      APR_CHECK_TCP_NODELAY_WITH_CORK
++fi
+ # Look for a way of corking TCP...
+ APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h)
diff --git a/net/freeswitch/patches/glibc/libs-apr-util-configure_gnu.patch b/net/freeswitch/patches/glibc/libs-apr-util-configure_gnu.patch
new file mode 100644 (file)
index 0000000..b933b3c
--- /dev/null
@@ -0,0 +1,8 @@
+--- a/libs/apr-util/configure.gnu
++++ b/libs/apr-util/configure.gnu
+@@ -1,4 +1,4 @@
+ #! /bin/sh
+ srcpath=$(dirname $0 2>/dev/null )  || srcpath="." 
+-$srcpath/configure "$@" --with-apr=../apr --disable-shared --with-pic --without-sqlite2 --without-sqlite3 --with-expat=builtin
++$srcpath/configure "$@" --with-apr=../apr --disable-shared --with-expat=builtin
diff --git a/net/freeswitch/patches/glibc/libs-srtp-configure_ac.patch b/net/freeswitch/patches/glibc/libs-srtp-configure_ac.patch
new file mode 100644 (file)
index 0000000..56c1691
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/libs/srtp/configure.ac
++++ b/libs/srtp/configure.ac
+@@ -130,10 +130,6 @@ if test "$enable_kernel_linux" = "yes";
+ fi
+ AC_MSG_RESULT($enable_kernel_linux)
+-dnl Check for /dev/urandom
+-AC_CHECK_FILE(/dev/urandom, DEV_URANDOM=/dev/urandom,
+-   [AC_CHECK_FILE(/dev/random, DEV_URANDOM=/dev/random)])
+-
+ dnl Checks for header files.
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(stdlib.h)
diff --git a/net/freeswitch/patches/glibc/src-mod-applications-mod_http_cache-conf-autoload_configs-http_cache_conf_xml.patch b/net/freeswitch/patches/glibc/src-mod-applications-mod_http_cache-conf-autoload_configs-http_cache_conf_xml.patch
new file mode 100644 (file)
index 0000000..27f1b5f
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/src/mod/applications/mod_http_cache/conf/autoload_configs/http_cache.conf.xml
++++ b/src/mod/applications/mod_http_cache/conf/autoload_configs/http_cache.conf.xml
+@@ -9,9 +9,9 @@
+     <param name="ssl-verifyhost" value="true"/>
+     <param name="ssl-verifypeer" value="true"/>
+     <!-- default is 300 seconds, override here -->
+-    <!--param name="connect-timeout" value="300"/-->
++    <!-- param name="connect-timeout" value="300"/> -->
+     <!-- default is 300 seconds, override here -->
+-    <!--param name="download-timeout" value="300"/-->
++    <!--param name="download-timeout" value="300"/> -->
+   </settings>
+   <profiles>
diff --git a/net/freeswitch/patches/glibc/src-mod-endpoints-mod_sofia-conf-sofia_conf_xml.patch b/net/freeswitch/patches/glibc/src-mod-endpoints-mod_sofia-conf-sofia_conf_xml.patch
new file mode 100644 (file)
index 0000000..78db028
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/mod/endpoints/mod_sofia/conf/sofia.conf.xml
++++ b/src/mod/endpoints/mod_sofia/conf/sofia.conf.xml
+@@ -216,7 +216,7 @@
+         <!-- <param name="unregister-on-options-fail" value="true"/> -->
+         <!-- Send an OPTIONS packet to all registered endpoints -->
+         <!--<param name="all-reg-options-ping" value="true"/>-->
+-        <!-- Send an OPTIONS packet to NATed registered endpoints. Can be 'true' or 'udp-only
++        <!-- Send an OPTIONS packet to NATed registered endpoints. Can be 'true' or 'udp-only -->
+         <!--<param name="nat-options-ping" value="true"/>-->
+         <!-- TLS: disabled by default, set to "true" to enable -->
diff --git a/net/freeswitch/patches/glibc/src-mod-endpoints-mod_verto-Makefile_am.patch b/net/freeswitch/patches/glibc/src-mod-endpoints-mod_verto-Makefile_am.patch
new file mode 100644 (file)
index 0000000..acf7216
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/src/mod/endpoints/mod_verto/Makefile.am
++++ b/src/mod/endpoints/mod_verto/Makefile.am
+@@ -9,19 +9,19 @@ mod_verto_la_LIBADD   = $(switch_builddi
+ mod_verto_la_LDFLAGS  = -avoid-version -module -no-undefined -shared
+ if HAVE_PERL
+-#perldir = $(PERL_SITEDIR)
+-noinst_LTLIBRARIES = MCAST.la
++perldir = /usr/lib/perl5/@PERL_VERSION@/CORE
++perl_LTLIBRARIES = MCAST.la
+ MCAST_la_SOURCES   = mcast/mcast_wrap.cpp mcast/perlxsi.c mcast/mcast.c mcast/mcast_cpp.cpp
+ MCAST_la_CFLAGS    = $(CC_CFLAGS) $(CFLAGS) $(SWITCH_AM_CFLAGS) $(PERL_CFLAGS)
+ MCAST_la_CXXFLAGS  = $(SWITCH_AM_CXXFLAGS) $(CXXFLAGS) -w $(PERL_INC)
+ MCAST_la_CPPFLAGS  = -I$(switch_srcdir)/src/mod/endpoints/mod_verto/mcast
+ MCAST_la_LDFLAGS   = -avoid-version -module -no-undefined -shared $(PERL_LDFLAGS)
+-#install-data-local: perlmod-install
++install-data-local: perlmod-install
+-#perlmod-install: install-perlLTLIBRARIES
+-#     install -d -m 755 $(DESTDIR)$(PERL_SITEDIR)
+-#     install -m 755 mcast/MCAST.pm $(DESTDIR)$(PERL_SITEDIR)
++perlmod-install: install-perlLTLIBRARIES
++      install -d -m 755 $(DESTDIR)$(perldir)
++      install -m 755 mcast/MCAST.pm $(DESTDIR)$(perldir)
+ endif
+ mcast/esl_wrap.cpp:
diff --git a/net/freeswitch/patches/glibc/src-mod-languages-mod_perl-Makefile_am.patch b/net/freeswitch/patches/glibc/src-mod-languages-mod_perl-Makefile_am.patch
new file mode 100644 (file)
index 0000000..fd3f1e5
--- /dev/null
@@ -0,0 +1,49 @@
+--- a/src/mod/languages/mod_perl/Makefile.am
++++ b/src/mod/languages/mod_perl/Makefile.am
+@@ -1,29 +1,27 @@
+ include $(top_srcdir)/build/modmake.rulesam
+ MODNAME=mod_perl
+-PERL        = perl
+-PERL_LIBDIR =-L`perl -MConfig -e 'print $$Config{archlib}'`/CORE
+-PERL_LIBS   =`perl -MConfig -e 'print $$Config{libs}'`
+-perldir=$(prefix)/perl
++perldir = /usr/lib/perl5/@PERL_VERSION@/CORE
+ mod_LTLIBRARIES = mod_perl.la
+ perl_LTLIBRARIES = freeswitch.la
+ mod_perl_la_SOURCES  = mod_perl.c freeswitch_perl.cpp mod_perl_wrap.cpp perlxsi.c
+-mod_perl_la_CFLAGS   = $(SWITCH_AM_CFLAGS)
+-mod_perl_la_CXXFLAGS = $(SWITCH_AM_CXXFLAGS)
+-mod_perl_la_CPPFLAGS = -w -DMULTIPLICITY `$(PERL) -MExtUtils::Embed -e ccopts` -DEMBED_PERL -I$(switch_srcdir)/libs/libteletone/src/ 
++mod_perl_la_CFLAGS   = $(SWITCH_AM_CFLAGS) @PERL_INC@
++mod_perl_la_CXXFLAGS = $(SWITCH_AM_CXXFLAGS) @PERL_INC@
++mod_perl_la_CPPFLAGS = @PERL_CFLAGS@ -I$(switch_srcdir)/libs/libteletone/src/
+ mod_perl_la_LIBADD   = $(switch_builddir)/libfreeswitch.la
+-mod_perl_la_LDFLAGS  = -avoid-version -module -no-undefined -shared `$(PERL) -MExtUtils::Embed -e ldopts` `$(PERL) -MConfig -e 'print $$Config{libs}'`
++mod_perl_la_LDFLAGS  = -avoid-version -module -no-undefined -shared @PERL_LDFLAGS@ @PERL_LIBS@
+ freeswitch_la_SOURCES = freeswitch_perl.cpp mod_perl_wrap.cpp perlxsi.c
+ freeswitch_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(LDFLAGS)
+-freeswitch_la_CPPFLAGS = $(SWITCH_AM_CPPFLAGS) -w -DMULTIPLICITY `$(PERL) -MExtUtils::Embed -e ccopts` -DEMBED_PERL -I$(switch_srcdir)/libs/libteletone/src/ 
++freeswitch_la_CPPFLAGS = $(SWITCH_AM_CPPFLAGS) @PERL_CFLAGS@ -I$(switch_srcdir)/libs/libteletone/src/
++
+ reswig:       swigclean mod_perl_wrap.cpp
+ swigclean: clean
+       rm -f mod_perl_wrap.* freeswitch.so freeswitch.pm
+ mod_perl_wrap.cpp:
+-      swig2.0 -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i
++      ${STAGING_DIR_HOSTPKG}/bin/swig -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i
+       echo "#include \"mod_perl_extra.c\"" >> mod_perl_wrap.cpp
+       patch -s -p0 -i hack.diff
+@@ -31,7 +29,7 @@ orig: mod_perl_wrap.cpp
+       patch -R -s -p0 -i hack.diff
+ .perlok:
+-      @(${PERL} -V | grep -i usemultiplicity=define >/dev/null && echo Phew, You have the right perl.) \
++      @(@PERL@ -V | grep -i usemultiplicity=define >/dev/null && echo Phew, You have the right perl.) \
+       || ((echo Sorry, you need to compile perl with threads and multiplicity.&& exit 1))
+       @touch .perlok
diff --git a/net/freeswitch/patches/glibc/src-mod-languages-mod_python-Makefile_am.patch b/net/freeswitch/patches/glibc/src-mod-languages-mod_python-Makefile_am.patch
new file mode 100644 (file)
index 0000000..185006e
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/src/mod/languages/mod_python/Makefile.am
++++ b/src/mod/languages/mod_python/Makefile.am
+@@ -2,7 +2,7 @@ include $(top_srcdir)/build/modmake.rule
+ MODNAME=mod_python
+ PYMOD=freeswitch
+-PYTHON_SITE_DIR=@PYTHON_SITE_DIR@
++PYTHON_SITE_DIR=/usr/lib/python@PYTHON_VER@/site-packages
+ SWIGCFILE=../../../switch_swig.c
+ SWIGIFILE=../../../switch_swig.i
+@@ -20,7 +20,7 @@ swigclean: clean
+       rm -f mod_python_wrap.* freeswitch.py
+ mod_python_wrap.cpp: mod_python_extra.c hack.diff 
+-      swig2.0 -python -c++ -I../../../../src/include -oh mod_python_wrap.h -o mod_python_wrap.cpp mod_python.i
++      ${STAGING_DIR_HOSTPKG}/bin/swig -python -c++ -I../../../../src/include -oh mod_python_wrap.h -o mod_python_wrap.cpp mod_python.i
+       echo "#include \"mod_python_extra.c\"" >> mod_python_wrap.cpp
+       patch -s -p0 -i hack.diff
diff --git a/net/freeswitch/patches/glibc/src-mod-languages-mod_python-freeswitch_python_cpp.patch b/net/freeswitch/patches/glibc/src-mod-languages-mod_python-freeswitch_python_cpp.patch
new file mode 100644 (file)
index 0000000..9d509c8
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/src/mod/languages/mod_python/freeswitch_python.cpp
++++ b/src/mod/languages/mod_python/freeswitch_python.cpp
+@@ -319,7 +319,12 @@ switch_status_t Session::run_dtmf_callba
+       }
+       if ((pyresult = PyEval_CallObject(cb_function, arglist))) {
++#if PY_MAJOR_VERSION < 3
+               str = (char *) PyString_AsString(pyresult);
++#else
++              //str = (char *) pyresult->encode('UTF-8');
++              str = (char *) PyUnicode_AsUnicode(pyresult);
++#endif
+       } else {
+               PyErr_Print();
+       }